﻿@model  Model.SysMenuInfo
@{
    ViewBag.Title = "添加菜单";
    Layout = "~/Views/Shared/_Main.cshtml";
}
@using BLL;
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/JScriptCommon.js")" type="text/javascript"></script>
<style type="text/css">
    input, textarea
    {
        width: 200px;
        border: 1px solid #ccc;
        padding: 2px;
    }
</style>
<link href="../../CSS/PageStyle.css" rel="stylesheet" type="text/css" />
@using (Html.BeginForm("Create", "SysMenu"))
{
    @Html.ValidationSummary(true, "输入数据不完整或有错误，请重新输入.")
    <div id="p" class="easyui-panel" style="width: 800px; padding: 10px 5px 10px 5px;"
         data-options="title:'菜单信息添加',iconCls:'icon-edit'">
        <div class="edit_main">
            <table style="text-align: right">
                <tr>
                    <td style="width: 50px; text-align: right">
                        <div class="editor-label2">
                            @Html.LabelFor(model => model.Name)：
                        </div>
                    </td>
                    <td>
                        <div class="editor-field2">
                            @Html.EditorFor(model => model.Name)
                            @Html.ValidationMessageFor(model => model.Name)
                        </div>
                    </td>
                    <td style="width: 80px; text-align: right">
                        <div class="editor-label2">
                            <a class="anUnderLine" onclick="showModalOnly('ParentId','../../SysMenu/Index');">
                                @Html.LabelFor(model => model.ParentId)：
                            </a>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field2">
                            <div id="checkParentId">
                            </div>
                            @Html.HiddenFor(model => model.ParentId)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label2">
                            @Html.LabelFor(model => model.Url)：
                        </div>
                    </td>
                    <td>
                        <div class="editor-field2">
                            @Html.EditorFor(model => model.Url)
                            @Html.ValidationMessageFor(model => model.Url)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label2">
                            <a class="anUnderLine" onclick="showMyWindow('选择图标', '../Home/Iconic');">
                                @Html.LabelFor(model => model.Iconic)：
                            </a>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field2">
                            <div id="Icon">
                            </div>
                            @Html.HiddenFor(model => model.Iconic)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label2">
                            @Html.LabelFor(model => model.Sort)：
                        </div>
                    </td>
                    <td>
                        <div class="editor-field2">
                            @Html.TextBoxFor(model => model.Sort, new { onkeyup = "isInt(this)", @class = "text-box single-line" })
                            @Html.ValidationMessageFor(model => model.Sort)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label2">
                            @Html.LabelFor(model => model.State)： 
                        </div>
                    </td>
                    <td>
                        <div class="editor-field2">
                            @Html.DropDownListFor(model => model.State, WebPortal.Controllers.SystemConfigurationController.DropDownStatus(), "--请选择--")
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label2">
                            <a class="anUnderLine" onclick="showModalMany('SysRightId','../../SysRights');">
                                @Html.LabelFor(model => model.SysRightId): <q>content</q>
                            </a>
                        </div>
                    </td>
                    <td>
                    </td>
                    <td>
                        <div class="editor-field2">
                            <div id="checkSysOperationId">
                                @if (Model != null && !string.IsNullOrWhiteSpace(Model.ParentId))
                                {
                                    foreach (var item13 in Model.ParentId.Split('^'))
                                    {
                                        string[] it = item13.Split('&');
                                        if (it != null && it.Length == 2 && !string.IsNullOrWhiteSpace(it[0]) && !string.IsNullOrWhiteSpace(it[1]))
                                        {                        
                     
                                            <table id="@item13  " class="deleteStyle">
                                                <tr>
                                                    <td>
                                                        <img alt="删除" title="点击删除" onclick="deleteTable('@item13','SysOperationId');"
                                                             src="../../../Images/deleteimge.png" />
                                                    </td>
                                                    <td>
                                                        @it[1]
                                                    </td>
                                                </tr>
                                            </table>
                                        }
                                    }
                                }
                                @Html.HiddenFor(model => model.SysRightId)
                            </div>
                        </div>
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <div class="configFoot">
            <input class="submitcss" type="submit" value="创建" />
            <input class="submitcss" type="button" onclick="back()" value="返回" />
        </div>
    </div>
}